<%@ page import="java.util.Arrays,java.util.List" %>
<%
/*	Enumeration<String> enumeration = request.getHeaderNames();
	while(enumeration.hasMoreElements()){
		String elemento = enumeration.nextElement();
		out.println(elemento + "=" + request.getHeader(elemento));
	}
	*/
	String header = request.getHeader("user-agent");
	header = header.toLowerCase();;
	List<String> lista = Arrays.asList("iphone","ipad","android","smartphone","palm","pda","operamini","windowsmobile","blackberry");
	boolean encontro = false;
	for(String item : lista){
		if(header.indexOf(item)!=-1){
			encontro = true;
			break;
		}
	}
	//redireccion a smartphones
	if(encontro){
		response.sendRedirect("faces/mobil/mapa.xhtml");		
	//redireccion normal
	}else{
		response.sendRedirect("faces/login.xhtml");		
	}
%>